<template>
  <div class="container">
    <div class="terminal-info-content" v-if="customData.agentName">
      <u-cell-item
        :arrow="false"
        hover-class="none"
        title="商户编号："
        :value="customData.merchNo"
        ><i
          slot="right-icon"
          class="iconfont icon-niantie"
          @click="copy(customData.merchNo)"
        ></i
      ></u-cell-item>
      <u-cell-item
        :arrow="false"
        hover-class="none"
        title="商户名称："
        :value="customData.merchName"
      />
      <u-cell-item
        :arrow="false"
        hover-class="none"
        title="代理商编号："
        :value="customData.agentNo"
      ></u-cell-item>
      <u-cell-item
        :arrow="false"
        hover-class="none"
        title="代理商名称："
        :value="customData.agentName"
      />
      <u-cell-item
        :arrow="false"
        hover-class="none"
        title="订单号："
        :value="customData.orderNo"
        ><i
          slot="right-icon"
          class="iconfont icon-niantie"
          @click="copy(customData.orderNo)"
        ></i
      ></u-cell-item>
      <u-cell-item
        :arrow="false"
        hover-class="none"
        title="机具sn号："
        :value="customData.serialno"
        ><i
          slot="right-icon"
          class="iconfont icon-niantie"
          @click="copy(customData.serialno)"
        ></i
      ></u-cell-item>

      <u-cell-item
        :arrow="false"
        hover-class="none"
        title="产品政策："
        :value="customData.policyName"
      />
    
      <u-cell-item
        :arrow="false"
        hover-class="none"
        title="交易金额："
        :value="'￥' + toFixedNum(customData.amount)"
      />
      <u-cell-item
        :arrow="false"
        hover-class="none"
        title="手续费："
        :value="toFixedNum(customData.fee)"
      />

      <u-cell-item
        :arrow="false"
        hover-class="none"
        title="交易日期："
        :value="customData.transDate"
        class="agent-info-list-cell"
      />
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      navBarOptions: {
        title: "交易详情",
        router: { name: "trading" },
        backPrevPage: true,
      },
      customData: {},
    };
  },
  created() {
    let option = this.$storage.getStore("tradingDetailInfo") || {};
    this.customData = option;
  },
  methods: {
    copy(value) {
      let _this = this;
      uni.setClipboardData({
        data: value,
        success: function () {
          _this.$tip.toast("复制成功!");
        },
      });
    },
    getCardType(tradInfo) {
      // if (tradInfo.transType) {
      return this.$options.filters["totalType"](
        tradInfo.transType,
        tradInfo.orderType
      );
      // } else if (tradInfo.tranType) {
      //   return  this.$options.filters["tranType"](tradInfo.tranType);
      // }
    },
    getCardType2(tradInfo) {
      if (tradInfo) {
        return this.$options.filters["cardType"](tradInfo.cardType);
      }
    },
  },
};
</script>

<style lang="scss" scoped>
.container {
  padding-top: R(20);
}
.terminal-info-content {
  margin: 0 R(20px);
  border-radius: R(20);
  background: #fff url(../../../common/images/newIcon/com-bg2.png) no-repeat;
  background-size: 100% auto;
}
</style>
